home *** CD-ROM | disk | FTP | other *** search
- property pSpr, pBottleSprite, pXliquorList, pXliquorMenu, pDefaultIngredient, pNewMouseLoc
- global gXliquorList
-
- on beginSprite me
- global gIngredients
- pSpr = sprite(me.spriteNum)
- mHidePopup(me)
- pXliquorList = []
- repeat with X = 1 to count(gIngredients)
- if getXbottleness(gIngredients[X]) then
- add(pXliquorList, getPropAt(gIngredients, X))
- end if
- end repeat
- pXliquorList = duplicate(gXliquorList)
- pXliquorMenu = "Default Liquor" & RETURN
- repeat with thisBottle in pXliquorList
- put getname(thisBottle) & RETURN after pXliquorMenu
- end repeat
- delete char -30000 of pXliquorMenu
- addAt(pXliquorList, 1, #dummy)
- customFont(pSpr.member)
- end
-
- on mShowPopup me, origSprite, defaultIngredient, newMouseLoc
- pDefaultIngredient = defaultIngredient
- pXliquorList[1] = pDefaultIngredient
- put getMediumName(pDefaultIngredient) into line 1 of pXliquorMenu
- if voidp(newMouseLoc) then
- pNewMouseLoc = the clickLoc
- else
- pNewMouseLoc = newMouseLoc
- end if
- pSpr.locH = min(pNewMouseLoc.locH, (the stage).rect.width - pSpr.member.width - 5)
- pSpr.locV = min(pNewMouseLoc.locV, (the stage).rect.height - pSpr.member.height - 15)
- pSpr.loc = pSpr.loc - 10
- pSpr.member.text = pXliquorMenu
- pBottleSprite = origSprite
- end
-
- on mouseDown me
- thisLine = the mouseLine
- if thisLine > 0 then
- newIngredient = pXliquorList[thisLine]
- sendSprite(pBottleSprite, #mUseXbottle, newIngredient)
- if not voidp(pNewMouseLoc) then
- placeCursor(pNewMouseLoc)
- end if
- end if
- mHidePopup(me)
- end
-
- on rightMouseDown me
- if the stage = the activeWindow then
- mouseDown(me)
- end if
- end
-
- on mouseWithin me
- thisLine = the mouseLine
- if thisLine > 0 then
- hilite line thisLine of field the member of pSpr
- end if
- end
-
- on mouseLeave me
- mHidePopup(me)
- end
-
- on mHidePopup me
- pSpr.locH = 1000
- end
-
- on endSprite
- end
-